'==================== Metody ========================

  Private Sub SetGaugeParameters()
    ' Cel: Ta procedura ustawia kilka parametrw, 
    '      ktre s uywane przez wskanik.
    '
    ' Lista argumentw:
    '  brak
    '
    ' Zwracana warto:
    '  niedostpna
    '
    If mCurrent > mMax Then     ' Warto zbyt dua?
      mCurrent = mMax
    End If

    If mCurrent < mMin Then    ' Warto zbyt maa?
      mCurrent = mMin
    End If
    mRange = mMax - mMin   ' Oblicz zakres wartoci wskanika 
    mTick = mRange / 5.0   ' Oblicz, gdzie powinien si zaczyna 
                           ' znak kontrolny 
    mGap = mTall / 5       ' Znajd przerwy pomidzy znakami kontrolnymi
  End Sub

  Private Sub Gauge_Resize(ByVal sender As Object, ByVal e As _
          System.EventArgs) Handles MyBase.Resize
    Dim ControlWidth As Integer = Me.ClientRectangle.Width
    Dim ControlHeight As Integer = Me.ClientRectangle.Height

    If ControlHeight < 50 Then    ' Ustaw minimaln wysoko formantu
      ControlHeight = 50
      Me.Height = 50
    End If

    If ControlWidth < 50 Then     ' Ustaw minimaln szeroko formantu
      ControlWidth = 50
      Me.Width = ControlWidth
    End If

    mTall = Me.Height * 0.9
    mTopSide = (Me.Height - mTall) / 2 ' Pooenie grnego 
                                       ' brzegu wskanika
    mLeftSide = Me.Width * 0.05     'Pooenie lewego brzegu wskanika
    mWide = Me.Width * 0.2       ' Szeroko wskanika

    Invalidate()

  End Sub
